import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Test1 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("d:/test.txt")){
            while(true) {
                byte[] buffer = new byte[1024];// 缓冲数组
                int len = inputStream.read(buffer);
                if(len == -1){
                    // 读取完毕
                    break;
                }
                for (int i = 0; i < len; i++) {
                    System.out.println(buffer[i]);
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
